From: Ron Yorston Date: Thu, 15 Nov 2012 20:57:15 +0000 (+0000) Subject: Add a setting for the default state of 'Remember Password' X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5333 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=71ad39b6e3f469ed72eea845f0e451746f6cff9d;p=gnome-shell.git Add a setting for the default state of 'Remember Password' https://bugzilla.gnome.org/show_bug.cgi?id=688039 --- diff --git a/data/org.gnome.shell.gschema.xml.in.in b/data/org.gnome.shell.gschema.xml.in.in index 5e09cbd49..dc32a4956 100644 --- a/data/org.gnome.shell.gschema.xml.in.in +++ b/data/org.gnome.shell.gschema.xml.in.in @@ -70,6 +70,16 @@ value here is from the GsmPresenceStatus enumeration. <_summary>Show full name in the user menu <_description>Whether the users full name is shown in the user menu or not. + + false + <_summary>Whether to remember password for mounting encrypted or remote filesystems + <_description> + The shell will request a password when an encrypted device or a + remote filesystem is mounted. If the password can be saved for + future use a 'Remember Password' checkbox will be present. + This key sets the default state of the checkbox. + + diff --git a/js/ui/shellMountOperation.js b/js/ui/shellMountOperation.js index 06eb814bf..2cc88a863 100644 --- a/js/ui/shellMountOperation.js +++ b/js/ui/shellMountOperation.js @@ -19,6 +19,8 @@ const ShellEntry = imports.ui.shellEntry; const LIST_ITEM_ICON_SIZE = 48; +const REMEMBER_MOUNT_PASSWORD_KEY = 'remember-mount-password'; + /* ------ Common Utils ------- */ function _setLabelText(label, text) { if (text) { @@ -387,7 +389,8 @@ const ShellMountPasswordDialog = new Lang.Class({ if (flags & Gio.AskPasswordFlags.SAVING_SUPPORTED) { this._rememberChoice = new CheckBox.CheckBox(); this._rememberChoice.getLabelActor().text = _("Remember Password"); - this._rememberChoice.actor.checked = true; + this._rememberChoice.actor.checked = + global.settings.get_boolean(REMEMBER_MOUNT_PASSWORD_KEY); this._messageBox.add(this._rememberChoice.actor); } else { this._rememberChoice = null; @@ -419,6 +422,8 @@ const ShellMountPasswordDialog = new Lang.Class({ }, _onEntryActivate: function() { + global.settings.set_boolean(REMEMBER_MOUNT_PASSWORD_KEY, + this._rememberChoice && this._rememberChoice.actor.checked); this.emit('response', 1, this._passwordEntry.get_text(), this._rememberChoice &&